/*
 * @Author: 大辉 dbstt@qq.com
 * @Date: 2022-11-24 13:36:55
 * @LastEditors: 大辉 dbstt@qq.com
 * @LastEditTime: 2023-05-06 18:13:55
 * @FilePath: /intelligentQuery/src/redux/index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { combineReducers } from 'redux';
import { configureStore } from '@reduxjs/toolkit';
import { persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import thunk from 'redux-thunk';

import counterReducer from './slice';
import Query from './query';
import SiteConfig from './siteConfig';
const persistConfig = {
  key: 'root',
  storage,
  // 黑名单 不缓存的
  blacklist:['query']
};
const reducers = combineReducers({
  counter: counterReducer,
  query: Query,
  siteConfig: SiteConfig
});
const persistedReducer = persistReducer(persistConfig, reducers);

export default configureStore({
  reducer: persistedReducer,
  // devTools: process.env.NODE_ENV !== 'production',
  middleware: [thunk],
});


